<?php

require_once(APPPATH.'controllers/epicentr.php');

class Timesheets extends Epicentr {

	public function Timesheets() {
		parent::Epicentr();
		
	}

	public function makePrivate($tsid) {
		$this->load->model('timesheetmodel');
		
		$ts = $this->timesheetmodel->retrieve_by_pkey($tsid);
		
		$this->timesheetmodel->modify($tsid, array('public' => 0) );
		
		redirect('jobs/showUpdates/'.$ts->jobid.'#timesheet-'.$ts->id);
	}
	
	public function makePublic($tsid) {
		$this->load->model('timesheetmodel');
		
		$ts = $this->timesheetmodel->retrieve_by_pkey($tsid);
		
		$this->timesheetmodel->modify($tsid, array('public' => 1) );
		
		redirect('jobs/showUpdates/'.$ts->jobid.'#timesheet-'.$ts->id);
	}
}

?>